
const checkPartHasEmpty = (partInfo) => {
  if (partInfo && partInfo.question_list && partInfo.question_list.length) {
    let questionList = partInfo.question_list;
    for (let i = 0; i < questionList.length; i++) {
      let answer = questionList[i].user_answer;
      if (answer.length) {
        for (let i = 0; i < answer.length; i++) {
          if (!answer[i]) {
            return true
          }
        }
      } else {
        return true;
      }
      // if (!questionList[i].user_is_answer) {
      //   return true;
      // }
    }
  }
  return false;
};

// 检查是否有空题
const checkAnswerAll = (paperInfo) => {
  if (paperInfo && paperInfo.part_list && paperInfo.part_list.length) {
    let partList = paperInfo.part_list;
    for (let i = 0; i < partList.length; i++) {
      if (checkPartHasEmpty(partList[i])) {
        return true;
      }
    }
  }
  return false;
}

export default checkAnswerAll;

